<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">

            <h:form>
                <p:panel toggleable="true" id="rawMaterialEdit" header="Raw Material Edit">
                    <h:panelGrid columns="3">
                       

                        <h:outputLabel value="Raw Material Name" />
                        <p:inputText id="name" value="#{rawMaterialEntityController.selected.productName}"  required="true" requiredMessage="Raw Material name is missing" />
                        <h:message styleClass="errorMsg" for= "name"/>
                        
                        <h:outputLabel value="Lead Time (week)"  />
                        <p:inputText id="leadTime" value="#{rawMaterialEntityController.selected.leadTime}"  required="true" requiredMessage="Lead Time is missing" />
                        <h:message styleClass="errorMsg" for= "leadTime"/>

                        <h:outputLabel value="Shelf Life (month)"  />
                        <p:inputText id="shelfLife" value="#{rawMaterialEntityController.selected.shelfLife}"  required="true" requiredMessage="Shelf Life is missing" />
                        <h:message styleClass="errorMsg" for= "shelfLIfe"/>

                    </h:panelGrid>
                </p:panel>
                <br/>

                <p:commandButton ajax="false" value="Update" action="#{rawMaterialEntityController.update}"/>
                <p:commandButton action="#{rawMaterialEntityController.resetCreate}" value="Reset"  ajax="false"/>       
                <p:commandButton action="#{rawMaterialEntityController.prepareList}" value="Back"  ajax="false" immediate="true"/>
            </h:form>
            
        </ui:define>
    </ui:composition>

</html>
